package com.dao;

import com.po.Activity;
import com.po.Type;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface TypeRepository extends JpaRepository<Type, Long>, JpaSpecificationExecutor<Type> {
    @Query(value = "select * from o_type inner join o_activity on o_type.id=o_activity.id where activity_state=1",nativeQuery = true)
    List<Type> findTop(Pageable pageable);


}
